package com.aaa.controller;

import com.aaa.annotation.MyLog;
import com.aaa.service.RoleService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: keyboard
 * @description:
 * @author: 闫克起2
 * @create: 2024-03-16 15:57
 **/
@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleService roleService;

    @GetMapping("/list/{current}/{pageSize}")
    @MyLog(businessType = "查询所有角色")
    public Result list(@PathVariable Integer current, @PathVariable Integer pageSize){
        return roleService.findAll(current, pageSize);
    }

    @GetMapping("/updateStatus")
    @MyLog(businessType = "修改角色状态")
    public Result updateStatus(Integer id,Integer status){
        int c=10/0;
        return roleService.updateStatus(id,status);
    }

}
